<?php
	if(isset($_GET['id']) && trim($_GET['id']) != "")
	{
		$MaKhoaHoc = strtoupper(trim($_GET['id']));
		include_once '../classes/khoahoc_bs.php';
		$KhoaHoc = new khoahoc_bs();
		$KhoaHoc->SetMaKhoaHoc($MaKhoaHoc);
		$DKhoaHoc = $KhoaHoc->LayDanhSach();
		if($DKhoaHoc != null)
		{
			if($DKhoaHoc[0]['MaTrangThai'] == 1)
				$KhoaHoc->SetMaTrangThai(2);
			else
				$KhoaHoc->SetMaTrangThai(1);
			$R = $KhoaHoc->CapNhatTrangThai();
		}
	}
	header('Location: index.php?act=khoahoc_danhsach');